﻿using System.Web.Mvc;

namespace Infrastructure.Mvc.SeedWork.RouterExtension
{
    public abstract class AreaRegistrationBase : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                string item = GetType().Name;
                return item.Replace("AreaRegistration", "");
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapLowerCaseUrlRoute(
                AreaName + "_default",
                AreaName.ToLower() + "/{controller}/{action}/{id}",
                new {action = "Index", id = UrlParameter.Optional}
                );
        }
    }
}